<?php
namespace Data;

class Sql extends \Data
{
    public static function Run($sql)
    {
        $num  = self::$db->exec($sql);
        $code = self::$db->errorCode();
        if ($code != 00000) {
            $info = self::$db->errorInfo();
            self::Error(json_encode($info) . "\r\n" . $sql, __FILE__, __LINE__);
        }
        return ["state" => "ok", "msg" => "操作成功", "num" => $num];
    }
}
